Repository navigation
codex: capture proxy traffic to disk (parity with Claude mitm) - #61
Merged
Merged
Conversation
…ents.jsonl
Brings Codex sessions up to parity with Claude's mitm proxy capture.
Bumps the codex-headless submodule to ffb6633 and wires the new
`eventsFile` option from cc-shell's CodexSession.
What's now captured per Codex session:
- One on-disk JSONL under
~/.config/cc-shell/proxy/<project>/<session>/<run>/proxy-events.jsonl
(path layout identical to Claude's mitm proxy capture).
- Every proxy event mirrored to the file: request, response-chunk,
response-end, response-error, request-error, upgrade-rejected,
server-error, rejected.
- For `kind: 'request'` events: filtered headers (x-codex-*,
x-openai-subagent, user-agent, content-length, content-type,
openai-beta) plus base64-encoded body (≤ 2 MiB) plus pre-parsed
request_shape (model, instructions_chars, input_items_count,
tools_count, has_reasoning).
Also picks up the adapter's endpoint-filter tightening from the
submodule: /responses/compact, /memories/trace_summarize, and other
sidecar endpoints stop touching the active-flow attribution state
machine.
cc-shell-side wiring (codexSession.ts):
- allocateProxyEventsFile() mints a fresh run dir per proxy
lifetime (a session restart gets its own dir, so multiple proxy
incarnations don't interleave on the same file).
- sessionKey naming mirrors claudeSession.ts exactly:
`resume-<id>` / `shell-<ts>`.
- Path components are sanitised so a malformed cwd or session id
can't escape the proxy root via path traversal.
No breaking changes: existing CodexSession callers get the new
capture for free; testing harness callers that construct
ResponsesProxy directly still default to no on-disk mirror.
Juliusolsson05
force-pushed
the
feat/codex-proxy-capture
branch
from
May 7, 2026 09:36
1ecce09 to
2c0da6f
Compare
Juliusolsson05
added a commit
that referenced
this pull request
Sep 20, 2026
…entory Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex sessions now mirror their proxy traffic to disk in the same JSONL shape as the Claude mitm proxy. After this lands, debug bundles inspecting Codex traffic have access to the same forensic data we already had for Claude — request bodies, headers, pre-parsed shape — and a single bundle-inspection tool can read either provider without branching.
What changes per Codex session
A new on-disk JSONL under `~/.config/cc-shell/proxy////proxy-events.jsonl` captures every proxy event:
Path layout is identical to the Claude proxy's so a single bundle reader can use one file path resolver for both.
Adapter tightening (bonus)
`CodexResponsesAdapter.onProxyEvent` previously filtered with `path.includes('/responses')` — a substring match that also accepted `/responses/compact` (the conversation compaction sidecar). Tightened to use the typed `endpoint === 'responses'` label the proxy already emits. Falls back to the legacy substring check when an older proxy doesn't send `endpoint`. Either way, `/responses/compact`, `/memories/trace_summarize`, and other sidecar endpoints no longer touch the active-flow attribution state machine.
Allowlist source-of-truth
Header allowlist derived by reading `vendor/codex-src/codex-rs/core/src/client.rs` — the headers that actually discriminate sidecar from main turn from subagent flows are:
Submodule
`packages/codex-headless` fix/feat-proxy-events-capture — commit `ffb6633`.
Verification
Companion PRs
🤖 Generated with Claude Code